//
//  MenuItemView.m
//  Mounter
//
//  Created by Marco Nätlitz on 02.08.10.
//  Copyright 2010 Chimpansoft. All rights reserved.
//

#import "MenuItemView.h"

#define menuItem ([self enclosingMenuItem])

@implementation MenuItemView

- (id)initWithFrame:(NSRect)frame {
    self = [super initWithFrame:frame];
    /*if (self) {
        // Initialization code here.
    }*/
    return self;
}

- (void)drawRect:(NSRect)rect {
    BOOL isHighlighted = [menuItem isHighlighted];
    if (isHighlighted) {
        [[NSColor selectedMenuItemColor] set];
        [NSBezierPath fillRect:rect];
    } else {
        [super drawRect: rect];
    }
}

- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { 
	return YES; 
}

- (void)viewDidMoveToWindow {
    [[self window] becomeKeyWindow];
}

@end
